/**
 * <p>Title: SmsDeviceMasSetting.java</p>
 * <p>Description: </p>
 * <p>Copyright: Baosight Software LTD.co Copyright (c) 2002</p>
 * <p>Company: Baosight Software</p>
 * @author 张志芳
 * @version 1.0
 * <pre>Histroy:
 *          2012-6-29 上午07:58:35  张志芳  Create
 *</pre>
 */
package com.baosight.sczx.common.zm.cInterface.ct;

import java.io.InputStream;
import java.util.List;
import java.util.Map;
import java.util.Properties;

/**
 * Mas机生成短信类
 * <p>Title: SmsDeviceMasSetting.java</p>
 * <p>Description: 使用Mas机发送短信</p>
 * <p>Copyright: Baosight Software LTD.co Copyright (c) 2002</p>
 * <p>Company: Baosight Software</p>
 * @author 张志芳
 * @version 1.0
 * <pre>Histroy:
 *          2012-6-29 上午07:58:35  张志芳  Create
 *</pre>
 */
public class SmsDeviceMasSetting implements IgenerateSms {

	public SmsDeviceMasSetting()
	{
		
	}
	
	/**
	 * 发送短信(批量)
	 * <p>Function: generateSms</p>
	 * <p>Description: List中的Map中应该有键值对为：content(短信内容), mobileNum(手机号码), createTime(短信生成时间)</p>
	 * <p>return value: SmsDeviceMasSetting</p>
	 * <p>throws Exception:</p>
	 * <p>History:
	 *    2012-6-29上午07:58:35 张志芳
	 * </p>
	 *
	 */
	@SuppressWarnings({ "rawtypes", "unused" })
	public void generateSms(List<Map> list) {
		
		Properties dbProps = new Properties();
		InputStream is = getClass().getResourceAsStream("/dbSMSMas.properties");
		try
		{
			dbProps.load(is);
			String masip = dbProps.getProperty("mas.ip");
			String masname = dbProps.getProperty("mas.name");
			String maspasswd = dbProps.getProperty("mas.passwd");
			String masaipid = dbProps.getProperty("mas.aipid");
			String masdbname = dbProps.getProperty("mas.dbname");
			
//			APIClient client = new APIClient();
//			int result = client.init(masip, masname, maspasswd, masaipid, masdbname);
//			
//			if(result == 0)
//			{
//				for(Map map : list)
//				{
//					long smId = Long.parseLong(StaticTools.getDateTime("ddHHmmss"));
//					result = client.sendSM(map.get("mobileNum").toString(), map.get("content").toString(), smId);
//				}
//				client.release();
//			}			
		}
		catch (Exception e)
		{
			
		}
	}

}
